//
//  MenuScene.h
//  SCRAP_ObjC
//
//  Created by SRL on 11/3/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <GameKit/GameKit.h>
#import "cocos2d.h"
#import "iPadSession.h"

@interface MenuScene : CCLayer <GKSessionDelegate>{
	CGSize size;
	CGPoint center;
	int menuTag;
	
	CCColorLayer *opacityLayer;
	
	NSMutableArray *players;
	NSMutableArray *circles;
	NSMutableArray *corners;
	int currentPlayerIndex;
	int currentCircleIndex;
	int schedPlayerCount;
	
	int maxScoreLimit;
	int maxRoundLimit;
	
	int scoreLimit;
	int roundLimit;
	
	bool isMoving;
	bool peerListScheduled;
	bool isStarted;
	
	/*
	// networking
	GKSession		*gameSession;
	NSString		*gamePeerId;
	*/
	iPadSession *gsession;
	CCMenu *menu;
	
	CCMenu *scoreMenu;
	CCMenu *roundMenu;
	CCMenuItemLabel *nextScoreItem;
	CCMenuItemLabel *prevScoreItem;
	CCMenuItemLabel *nextRoundItem;
	CCMenuItemLabel *prevRoundItem;
	CCLabel *scoreLabel;
	CCLabel *roundLabel;
	CCMenu *typeMenu;
	CCMenuItemLabel *nextTypeItem;
	CCMenuItemLabel *prevTypeItem;
	CCLabel *typeLabel;
	bool scoreMode;
}


@property int maxScoreLimit;
@property int maxRoundLimit;
@property int scoreLimit;
@property int roundLimit;
@property bool scoreMode;
@property (retain) CCMenu *menu;
@property (retain) CCMenu *scoreMenu;
@property (retain) CCMenu *roundMenu;
@property (retain) CCMenuItemLabel *nextScoreItem;
@property (retain) CCMenuItemLabel *prevScoreItem;
@property (retain) CCMenuItemLabel *nextRoundItem;
@property (retain) CCMenuItemLabel *prevRoundItem;
@property (retain) CCLabel *scoreLabel;
@property (retain) CCLabel *roundLabel;
@property (retain) CCMenu *typeMenu;
@property (retain) CCMenuItemLabel *nextTypeItem;
@property (retain) CCMenuItemLabel *prevTypeItem;
@property (retain) CCLabel *typeLabel;

@property int menuTag;
@property (retain) CCColorLayer *opacityLayer;
@property CGSize size;
@property CGPoint center;
@property (retain) NSMutableArray *players;
@property (retain) NSMutableArray *circles;
@property (retain) NSMutableArray *corners;
@property int currentPlayerIndex;
@property int currentCircleIndex;
@property int schedPlayerCount;
@property bool isMoving;
@property bool peerListScheduled;
@property bool isStarted;
@property (retain, nonatomic) GKSession *gameSession;
@property (retain, nonatomic) NSString *gamePeerId;

+(id)scene;
//-(void)updatePeerList:(ccTime)dt;
//-(void)start;
-(void)connect;

-(void) scorePrev;
-(void) scoreNext;

//-(CGPoint)nearestCorner:(CGPoint)p;
//-(float)distanceBetweenTwoPoints:(CGPoint)a withPointB:(CGPoint)b;

@end
